<?php
require_once 'bbs/include/common.inc.php';
require_once 'classes/include.php';
require_once 'classes/pager.class.php';

$id = intval($_GET["id"]);
$info = getDescFromTopics($id);
$showtype = $info[4];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>北京市京师律师学校</title>
<link rel="stylesheet" href="./css/base.css" type="text/css"/>
<link rel="stylesheet" href="./css/superfish.css" type="text/css"/>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/hoverIntent.js"></script>
<script type="text/javascript" src="js/superfish.js"></script>
<script type="text/javascript">
$(function()
{
	$("#navigationMenu").superfish();
});
</script>
</head>
<body>
<div class="PageContainer">
	<? include("classes/page_header.php"); ?>
	<div class="PageContent">
		<div class="PageContentBlock PicturesMarquee Level2">
			<img src="<?=getTopicBanner($id);?>"/>
		</div>
		
		<div class="PageContentBlock SectionPath">
			<p>
				<span class="NormalText">您现在的位置：</span>
				<span class="Path">
					<?=getPath($id)?>
				</span>
			</p>
		</div>
		
		<div class="PageContentBlock TwoColumnsContainer">
			<? include("classes/page_left.php"); ?>	
			<div class="TwoColumnsContent_Right" style="line-height:22px">
				<!-- <img src="images/lv2articlesample.jpg" style="margin-buttom:25px;"/> -->
<?php
if($showtype == 2){
	
	
	//获取记录总数
	$count_sql		= "select count(*) as amount from article where topiccode = '".$id."'";
  $count_query	= $db->query($count_sql);
  $res_amount		= $db->fetch_array($count_query);
  $total_amount	= $res_amount['amount'];

	/*
	 *	翻页类使用(classes/pager.class.php)
	 *	传入总共记录数和每页显示条数
	 *	$pager->gethtml(); 		得到翻页的html代码，直接打印即可
	 *	$pager->get_limit();	拼出sql语句中的limit语句
	 *
	*/
	if( $total_amount > 0 )
	{
		$pager		= new pager( $total_amount, $pernum=ARTICLE_SHOW_NUMBER);
		$pagers		= $pager->gethtml();
		//$pager_url	= $pager->geturl();
		$limit		= $pager->get_limit();
	}else{
		$limit		= 1;
	}
	
	$sql = "select * from article where topiccode = '".$id."' limit ".$limit;
	$query = $db->query($sql);
	while($rs = $db->fetch_array($query))
	{
		$news_id					= $rs["id"];
		$title			= $rs["title"];
		$topiccode	= $rs["topiccode"];
		$content		= html_entity_decode ( $rs["content"] );
		$time = date("m-d", $rs['inputtime']);
?>
	&nbsp;&nbsp;&nbsp;&nbsp;[<?php echo $time; ?>]&nbsp;&nbsp;<a href="./news.php?newsid=<?=$news_id?>"><?=$title?></a></br>
<?
	}
	echo "<p align=\"center\">";
	echo $pagers;
	echo "</p>";
}else{
	$sql = "select * from article where topiccode = '".$id."' order by id desc limit 1";
	$query = $db->query($sql);
	$rs = $db->fetch_array($query);
	$content	= html_entity_decode ( $rs["content"] );
	echo $content;
	if($id == "701"){
		echo "<p align=\"right\">>> <a href=\"/bbs/forumdisplay.php?fid=".ForumIds::id1."\">进入法律英语培训专区</a></p>";
	}elseif($id == "702"){
		include('xt.php');
	}elseif($id == "703"){
		echo "<p align=\"right\">>> <a href=\"/bbs/forumdisplay.php?fid=".ForumIds::id2."\">进入司法考试专区</a></p>";
	}elseif($id == "704"){
		echo "<p align=\"right\">>> <a href=\"/bbs/forumdisplay.php?fid=".ForumIds::id3."\">进入律师事务专区</a></p>";
	}
}
?>


			</div>
		</div>
		
	</div>
	<? include("classes/page_footer.php"); ?>	
</div>
</body>
</html>